<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>二维码生成器 - 最终测试</title>
    <style>
        body {
            margin: 0;
            padding: 20px;
            width: 700px;
            height: 500px;
            overflow: hidden;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: #333;
        }
        
        .container {
            background: white;
            border-radius: 15px;
            padding: 25px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
            height: calc(100% - 50px);
            display: flex;
            flex-direction: column;
        }
        
        .header {
            text-align: center;
            margin-bottom: 20px;
        }
        
        .header h1 {
            margin: 0;
            color: #4a5568;
            font-size: 24px;
            font-weight: 600;
        }
        
        .input-section {
            margin-bottom: 20px;
        }
        
        .input-group {
            margin-bottom: 15px;
        }
        
        label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
            color: #4a5568;
        }
        
        #textInput {
            width: 100%;
            min-height: 80px;
            padding: 12px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            font-size: 14px;
            font-family: inherit;
            resize: vertical;
            transition: border-color 0.3s ease;
            box-sizing: border-box;
        }
        
        #textInput:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }
        
        .char-count {
            text-align: right;
            font-size: 12px;
            color: #666;
            margin-top: 5px;
        }
        
        .button-group {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
        }
        
        .btn {
            padding: 10px 20px;
            border: none;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            flex: 1;
        }
        
        .btn-primary {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
        }
        
        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
        }
        
        .btn-secondary {
            background: #f7fafc;
            color: #4a5568;
            border: 1px solid #e2e8f0;
        }
        
        .btn-secondary:hover {
            background: #edf2f7;
        }
        
        .btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none !important;
        }
        
        .qr-section {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-height: 200px;
        }
        
        #qrcode {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 200px;
            border: 2px dashed #e2e8f0;
            border-radius: 8px;
            background: #f7fafc;
            width: 100%;
        }
        
        #qrcode table {
            border-collapse: collapse;
            margin: 0;
        }
        
        #qrcode td {
            padding: 0;
            margin: 0;
            border: none;
        }
        
        .placeholder {
            color: #a0aec0;
            font-size: 16px;
            text-align: center;
        }
        
        #downloadBtn {
            display: none;
            margin-top: 15px;
        }
        
        .status {
            text-align: center;
            margin-top: 10px;
            font-size: 12px;
            color: #666;
        }
        
        .error {
            color: #e53e3e;
            background: #fed7d7;
            padding: 10px;
            border-radius: 6px;
            margin: 10px 0;
            text-align: center;
        }
        
        .success {
            color: #38a169;
            background: #c6f6d5;
            padding: 10px;
            border-radius: 6px;
            margin: 10px 0;
            text-align: center;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>🔲 二维码生成器</h1>
        </div>
        
        <div class="input-section">
            <div class="input-group">
                <label for="textInput">输入要生成二维码的内容：</label>
                <textarea id="textInput" placeholder="请输入文本、网址或其他内容..."></textarea>
                <div class="char-count">
                    <span id="charCount">字符数: 0</span>
                </div>
            </div>
            
            <div class="button-group">
                <button id="generateBtn" class="btn btn-primary">生成二维码</button>
                <button id="clearBtn" class="btn btn-secondary">清除</button>
            </div>
        </div>
        
        <div class="qr-section">
            <div id="qrcode">
                <div class="placeholder">在上方输入内容，然后点击"生成二维码"</div>
            </div>
            <button id="downloadBtn" class="btn btn-secondary">下载二维码</button>
        </div>
        
        <div class="status" id="status"></div>
    </div>
    
    <script src="qrcode.min.js"></script>
    <script src="popup.js"></script>
</body>
</html>